# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=qml-asteroid
pkgver=0_git20210517
pkgrel=1
_commit="8945fa436e3fbb646bc35a9aa60c430323d7f2a7"
pkgdesc="QML components, styles and demos for AsteroidOS"
url="https://github.com/AsteroidOS/qml-asteroid"
# armhf blocked by qt5-qtvirtualkeyboard
arch="all !armhf"
license="LGPL-2.1-only"
depends="qt5-qtvirtualkeyboard"
# grep is required for the asteroid-generate-desktop.sh script, which is used by other packages
depends_dev="
	grep
	mlite-dev
	qt5-qtbase-dev
	qt5-qtdeclarative-dev
	qt5-qtsvg-dev
	qt5-qttools-dev
	"
makedepends="$depends_dev
	extra-cmake-modules
	mapplauncherd-qt-dev
	"
subpackages="$pkgname-dbg $pkgname-dev"
source="https://github.com/asteroidos/qml-asteroid/archive/$_commit/qml-asteroid-$_commit.tar.gz"
builddir="$srcdir/$pkgname-$_commit"

build() {
	cmake -B build \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DINSTALL_QML_IMPORT_DIR=/usr/lib/qt5/qml
	cmake --build build
}

check() {
	cd build
	CTEST_OUTPUT_ON_FAILURE=TRUE ctest
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

dev() {
	default_dev

	amove usr/share/*/cmake
	amove usr/bin
}

sha512sums="
b0bfc7f9ab090b319beba86091c987521f5d9a039c21e51c95a0336e0acf515bed88eb97fa42521daedfa5b45dfc7c3a81365eacd980c54ebaf311a2a573fadb  qml-asteroid-8945fa436e3fbb646bc35a9aa60c430323d7f2a7.tar.gz
"
